using CombineRemoteAndLocalSchemaDemo.Gateway.GraphTypes;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpClient("orders", c =>
{
    c.BaseAddress = new Uri("http://localhost:5050/graphql");
});

builder.Services.AddGraphQLServer()
    .AddRemoteSchema("orders")
    .AddLocalSchema("LocalTest")
    .AddTypeExtensionsFromFile("./Stitching.graphql");

builder.Services.AddGraphQLServer("LocalTest")
    .AddQueryType()
    .AddTypeExtension<GatewayResolver>();

var app = builder.Build();
app.MapGraphQL();
app.Run();